package com.gxuwz.medical.domain.vo;
import java.util.List;

import com.gxuwz.medical.exception.MenuTreeException;
/**
 * 菜单树的节点
 * 
 * @author k88
 * 
 */
public class MenuTreeNode {
	/**
	 * 菜单编号
	 */
	private String menuid;
	/**
	 * 菜单名称
	 */
	private String menuName;
	/**
	 * 是否选中
	 */
	private boolean checked;
	
	private List<MenuTreeNode> childrens;

	public MenuTreeNode(String menuid, 
			String menuName, boolean checked) {
      this.menuid=menuid;
      this.menuName=menuName;
      this.checked=checked;
	}
    public MenuTreeNode(String nodeid){
    	this.menuid=nodeid;
    }
	public String getMenuid() {
		return menuid;
	}

	public void setMenuid(String menuid) {
		this.menuid = menuid;
	}

	public String getMenuName() {
		return menuName;
	}

	public void setMenuName(String menuName) {
		this.menuName = menuName;
	}

	public boolean isChecked() {
		return checked;
	}

	public void setChecked(boolean checked) {
		this.checked = checked;
	}

	public List<MenuTreeNode> getChildrens() {
		return childrens;
	}

	public void setChildrens(List<MenuTreeNode> childrens) {
		this.childrens = childrens;
	}
	
	public MenuTreeNode tree(String nodeid)throws MenuTreeException{
		try{
			MenuTreeNode  node =new MenuTreeNode(nodeid);
			return node;
		}catch (Exception e) {
			throw new MenuTreeException("生成菜单树失败"+e.getMessage(),e);
		}
		
	}
	

}
